<?=$headerHtml?>
        <div class="container">
                <h2 class="admintitle">文章管理<div class="admintitle_r"><a href="?c=<?=$ctlName?>&a=addShow&appId=<?=$appId?>">添加</a></div></h2>
                <div class="selarea" style="width:99%;">
                    <form method="get" action="index.php">
                    频道:<?
                        $options = array(
                            'id'   => 'classId',
                            'name' => 'sel[classId]',
                            'data' => $classCache,
                            'key'  => $sel['classId'],
                        );
                        echo Libs_GlobalFunc::createSelectElement($options);
                    ?>
                    状态:<?
                        $options = array(
                            'id'   => 'status',
                            'name' => 'sel[status]',
                            'data' => array(0=>'未发布',3=>'已发布',1=>'已删除'),
                            'key'  => $sel['status'],
                            'defaultValue'  => '-1',
                        );
                        echo Libs_GlobalFunc::createSelectElement($options);
                    ?>
                    标题:<input type="text" name="sel[keyword]" value="<?=$sel['keyword']?>"/>
                    文件名:<input type="text" name="sel[enfile]" value="<?=$sel['enfile']?>" style="width:80px;"/>
                    <input type="submit" value="搜索"/>
                    <input type="hidden" name="c" value="<?=$ctlName?>"/>
                    <input type="hidden" name="appId" value="<?=$appId?>"/>
                    </form>
                </div>
        <form method="post" action="index.php" target="_self">
        <input type="hidden" value="<?=$ctlName?>" name="c" id="c"/>
        <input type="hidden" value="<?=$actName?>" name="a" id="a"/>
        <input type="hidden" value="<?=$appId?>" name="appId" id="appId"/>
                <? if($list){?>
                <div id="srchuserdiv" class="tabcontentcur" style="width:99%;">
                    <table  class="datalist fixwidth">
						<tbody><tr>
							<th nowrap="nowrap">&nbsp;</th>
							<th nowrap="nowrap">id</th>
							<th nowrap="nowrap">标题</th>
							<th nowrap="nowrap">属性</th>
							<th nowrap="nowrap">频道</th>
							<th nowrap="nowrap">用户名</th>
							<th nowrap="nowrap">点击</th>
							<th nowrap="nowrap">时间</th>
							<th nowrap="nowrap">详情</th>
						</tr>
                            <?foreach($list as $row){
                                $titleCss = $titlePre = '';
                                if(1 == $row['status']){
                                    $titleCss = 'delDoc';
                                    $titlePre = '<img src="./images/trash.gif" algin="absmiddle"/>&nbsp;';
                                }
                            ?>

							<tr>
								<td width="30"><input type="checkbox" name="ids[]" value="<?=$row['id']?>" class="selIdCkbox"/></td>
								<td width="40"><?=$row['id']?>&nbsp;</td>
								<td class="doctitle <?=$titleCss?>"><?=$titlePre?><a href="index.php?c=<?=$ctlName?>&a=AddShow&id=<?=$row['id']?>&appId=<?=$appId?>" target="_blank"><?=$row['title']?></a>&nbsp;</td>
								<td >
                                    <?
                                    if(3 == $row['status']){
                                        $url = Libs_Cms_Document::getDocumentUrl('',$classCache[$row['classId']]['path'], $row['id'], $row['enfile']);
                                        echo '<a href="'.$url.'" target="_blank"><img src="./images/select.gif" algin="absmiddle" title="该文章已经发布"/></a>';
                                    }
                                    ?>&nbsp;
                                </td>
                                <td ><?=$classCache[$row['classId']]['name']?>&nbsp;</td>
                                <td ><?=$row['username']?>&nbsp;</td>
                                <td ><?=$row['hits']?>&nbsp;</td>
								<td ><?=date("Y-m-d H:i:s",$row['datetm'])?>&nbsp;</td>
								<td >
                                    <a href="index.php?c=<?=$ctlName?>&a=RelDel&id=<?=$row['id']?>&appId=<?=$appId?>">彻底删除</a> |
                                    <a href="index.php?c=<?=$ctlName?>&a=Del&id=<?=$row['id']?>&appId=<?=$appId?>">删除</a> |
                                    <a href="index.php?c=<?=$ctlName?>&a=Restore&id=<?=$row['id']?>&appId=<?=$appId?>">恢复</a> |
                                    <a href="index.php?c=<?=$ctlName?>&a=AddShow&id=<?=$row['id']?>&appId=<?=$appId?>">编辑</a> |
                                    <a href="index.php?c=<?=$ctlName?>&a=Publish&id=<?=$row['id']?>&appId=<?=$appId?>" target="_blank">发布</a>
                                </td>
							</tr>
							<?}?>
                            <tr><td colspan="8"><input type="checkbox"  onclick="reverseSel()">反选
                             <select id="toClassId">
                                <? foreach($classCache as $tmpc){
                                      if($tmpc['appId'] != $appId)continue;
                                ?>
                                <option value="<?=$tmpc['id']?>"><?=$tmpc['name']?></option>
                                <?}?>
                            </select>
                           <input type="button" value="转移" onclick="doSubmit(this.form,<?=$appId?>,'<?=$ctlName?>','move','?toClassid='+$('#toClassId').val())"></td></tr>
					</tbody></table>
                    <div class="opArea" style="display:none;">
                        <input type="button" value=" 发布 " onclick="doOp('')" class="opbtn" style="width:80px;"/>&nbsp;&nbsp;&nbsp;&nbsp;
                        <input type="button" value="删除" class="opbtn"/>
                        <input type="button" value="恢复" class="opbtn"/>
                        <input type="button" value="彻底删除" class="opbtn"/>
                    </div>
                    <div class="pageBar"><?=$pageBar?></div>



            </div>
            <?}else{?>
            <div class="mainbox">
                <div class="note">
                    <p class="i">目前没有相关数据!
                    
                    </p>
                </div>
            </div>
            <?php
                }
            ?>

    </form>
        </div>

    <script>
    function goOtherApp(appId){
        window.location.href='index.php?c=Cms_Document&appId=' + appId;
    }
    </script>
    </body>
</html>
